<template>
  <p>
    姓名: <input type="text" v-model="info.name" />
  </p>
  <p>
    年龄: <input type="number" v-model="info.age" />
  </p>
  <p>
    编码: <input type="text" v-model="info.code" />
  </p>
</template>
<script setup lang="ts">
/**
 * 使用watch监听对象
 */
import { reactive, watch } from 'vue'

const info = reactive({
  name: '',
  age: 0,
  code: ''
})

watch(info, (a, b, c) => {
  console.log(info)
})
</script>